/*
 * @Author: TalkMan
 * @Date: 2021-06-01 8:51:03
 * @LastEditTime: 2021-06-01 14:15:13
 * @LastEditors: TalkMan
 * @Description: 农资入库接口
 */

import xjaxios from "@/api/axios";
export default {
  /**
   * @description: 获取农资入库信息 *代表必填
   * @param {String/Number} page *
   * @param {String/Number} size *
   * @param {Object} entity {componyId: 1} *
   * @param {String} order 排序方式 ASC DESC 默认ASC
   * @param {String} sort 自定义排序方式 'createTime'
   * @return {Array}
   */
  getAgriMateWareHousingList(params) {
    return xjaxios.post(`/material/inQueryPageList`, params);
  },

  /**
   * @description: 新增农资入库信息
   * @param {Object} formData *
   * @return {Object}
   */
  addAgriMateWareHousing(formData) {
    formData.organizationNo = sessionStorage.organizationNo;
    return xjaxios.post(`/material/inWarehousing`, formData);
  },

  /**
   * @description: 编辑农资入库信息
   * @param {Object} formData *
   * @return {Object}
   */
  editAgriMateWareHousing(formData) {
    return xjaxios.post(`/material/editInWarehousing`, formData);
  },
  delAgriMateWareHousing(list) {
    // console.log(list)
    return xjaxios.post(`/material/delInList`, { agriculturalMaterialWarehousingIdList: list });
  }

  /**
   * @description: 批量删除数据
   * @param {Array} list *
   * @return {Object}
   */
  // delAgriMateWareHousing(list) {
  //   return xjaxios.post(`/material/delInList`, {
  //     AgriculturalMaterialWarehousingIdList: list
  //   });
  // },

  // 删除一个
  // delOnly: id => xjaxios.get(`/material/delIn/${id}`)
};
